package com.ai;

import javax.swing.*;
import java.awt.*;

public class SimpleBorderLayer extends JFrame {

    private void setFrameStyle() {

    }

    public SimpleBorderLayer() throws HeadlessException {

        JButton jbtStartEnv = new JButton("启动环境");
        JButton jbtAddEnv = new JButton("添加环境");
        JButton jbtDelEnv = new JButton("移除环境");
        JPanel p = new JPanel();

        setLayout(new BorderLayout(5, 10));
        setTitle("starter");

        p.setLayout(new GridLayout(1, 2, 5, 5));
        p.add(jbtAddEnv);
        p.add(jbtDelEnv);

        add(jbtStartEnv, BorderLayout.NORTH);
        add(p, BorderLayout.SOUTH);
        add(new JButton("Hello World"), BorderLayout.CENTER);

        setSize(400, 300);
        setLocationRelativeTo(null);

        String imgPath = "src/main/resources/icon/icon.png";
        setIconImage(new ImageIcon(imgPath).getImage());

        setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
        setVisible(true);

    }

    public static void main(String[] args) {
        new SimpleBorderLayer();
    }

}
